<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <button @click="num--" :disabled="num<=1">-</button>
    <span>{{num}}</span>
    <button @click="num++" :disabled="num>=10">+</button>
  </div>
</body>
<script src="./vue.js"></script>
<script>
  const {createApp,ref} = Vue;
  createApp({
    setup () {
      let num = ref(1)

      return {
        num
      }
    }
  }).mount('#app')
  // v-show 适用于选项卡 dom频繁的切换
  // v-if dom销毁和重新创建  初始化时确认了状态
</script>
</html>